package com.show.mybatis.sqlSession.impl;

import com.show.mybatis.factory.MapperProxyFactory;
import com.show.mybatis.sqlSession.SqlSession;

import java.lang.reflect.Proxy;

public class DefaultSqlSession implements SqlSession {
    @Override
    public <T> T getMapper(Class<T> daoClass) {
        return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(),
                new Class[]{daoClass},
                new MapperProxyFactory());
    }
}
